from datetime import datetime, timedelta

from sqlalchemy import *
from sqlalchemy.ext.activemapper import ActiveMapper, column, \
                                    one_to_many, one_to_one, many_to_many

from turbogears.database import metadata, session

def expires():
    return datetime.now() + timedelta(minutes = 5)

class SitemapCache(ActiveMapper):
    class mapping:
        sitemap_name = column(Unicode(255), primary_key=True)
        content = column(Unicode())
        date_modified = column(DateTime, default=datetime.now)
        date_expires = column(DateTime, default=datetime.now)

